<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>this.props.children</title>
    <script src="../build/react.development.js"></script>
    <script src="../build/react-dom.development.js"></script>
    <script src="../build/babel.min.js"></script>
</head>
<body>
    <div id="app"></div>
    <script type="text/babel">
        let app = document.getElementById('app')
        class NodeList extends React.Component{
            getList(){   //  封装
                // console.log(React)
                // console.log(React.Children)
                return this.props
            }
            render(){
                return(
                    <ol>
                        {
                            React.Children.map(this.getList().children,(item)=>{
                                console.log(this.props,'---props---');
                                return  <li>{item}---{this.getList().name}</li>
                            })
                        }
                    </ol>
                )
            }
        }
        ReactDOM.render(<NodeList name="jack">
            <span>hello</span>
            <span>world</span>
        </NodeList>,app)
    </script>
</body>
</html>